//
//  DepoistHeadView.swift
//  d11
//
//  Created by peale on 2018/10/20.
//  Copyright © 2018年 Tech_001. All rights reserved.
//

import UIKit

class DepoistHeadView: UITableViewHeaderFooterView {

    var bgImgView : UIImageView?
    var nameLabel : UILabel?
    override init(reuseIdentifier: String?) {
        super.init(reuseIdentifier: reuseIdentifier)
        self.contentView.backgroundColor = UIColor.white
        self.bgImgView = UIImageView.init()
        self.bgImgView?.backgroundColor = UIColor.white
        self.bgImgView?.image = imageNamed("icon_depoist_head_top")?.resizableImage(withCapInsets: UIEdgeInsets(top: 5, left: 30, bottom: 5, right: 30),resizingMode: .stretch) //左右15像素的部分不变，中间部分来拉伸
        self.contentView.addSubview(bgImgView!);
        self.bgImgView?.snp.makeConstraints{(make) in
            make.width.equalToSuperview()
            make.height.equalTo(40.5)
            make.centerX.equalTo(self.contentView)
        };
        
        
        self.nameLabel = UILabel.init()
        self.nameLabel?.textColor = HexRGBAlpha(0x90918e, 1)
        self.nameLabel?.font = UIFont.systemFont(ofSize: 15)
        self.nameLabel?.text = "支付通道"
        self.nameLabel?.textAlignment = NSTextAlignment.center
        self.bgImgView?.addSubview(self.nameLabel!)
        
        self.nameLabel?.snp.makeConstraints{(make) in
            make.centerX.equalToSuperview()
            make.width.equalToSuperview()
            make.height.equalToSuperview()
            make.top.equalToSuperview().offset(5)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    
     func setData(title:String) -> Void {
        self.nameLabel?.text = title
    }
}
